<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>门诊发票报表管理</title>
<meta name="decorator" content="default"/>
<script src="${ctxStatic}/common/change/change.js"></script>
<style type="text/css">	
    body{
        padding:10px;
    }	
	#contentTable td ,#contentTable th{
		text-align: center;
		padding:1px 20px;
	}
	#contentTable {
	    padding:1px 4px;
	}
	.minWidth {
		min-width: 177px;
	}	
</style>
<script type="text/javascript">
$(document).ready(function() {
	initVaccName(bsChargeLogVaccList.companyCode,bsChargeLogVaccList.vaccCode);
	$(".vaccineCompany").change(function(){
		var vaccId = $(this).val();
		initCompanyName($(this).val());
		if(vaccId == ""){
			initVaccCompanyName("");
		}
	});
});
var bsChargeLogVaccList = JSON.parse('${fns:toJson(bsChargeLogVaccList)}');
function page(n,s){
	$("#pageNo").val(n);
	$("#pageSize").val(s);
	$("#searchForm").submit();
    return false;
}
function down(){
	top.$.jBox.confirm("确认导出发票金额统计数据吗？","系统提示",function(v,h,f){
		if(v=="ok"){
			$("#searchForm").attr("action","${ctx}/chargelog/bsChargeLog/chargeLogVaccListExport");
			$("#searchForm").submit();
			$("#searchForm").attr("action","${ctx}/chargelog/bsChargeLog/findByVaccLocalCodeList");
		}
	},{buttonsFocus:1});
	top.$('.jbox-body .jbox-icon').css('top','55px');
}
</script>
</head>
<body>
	<form:form id="searchForm" modelAttribute="bsChargeLogVaccList" action="${ctx}/chargelog/bsChargeLog/findByVaccLocalCodeList" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<input id="department" name="department" type="hidden" value="${bsChargeLogVaccList.department}"/>
		<input id="localCode" name="localCode" type="hidden" value="${bsChargeLogVaccList.localCode}"/>
		<input id="paytype" name="paytype" type="hidden" value="${bsChargeLogVaccList.paytype}"/>
		<input id="createByName" name="createByName" type="hidden" value="${bsChargeLogVaccList.createByName}"/>
		<input id="beginDate" name="beginDate" type="hidden" value="<fmt:formatDate value="${bsChargeLogVaccList.beginDate}" pattern="yyyy-MM-dd"/>"/>
		<input id="endDate" name="endDate" type="hidden" value="<fmt:formatDate value="${bsChargeLogVaccList.endDate}" pattern="yyyy-MM-dd"/>"/>
		<table class="table table-bordered">
		   <tr>
				<th>接种门诊：</th>
				<td>
					<form:input path="department"  htmlEscape="false" maxlength="255" class="span2 minWidth" disabled="true" readonly="true"/>
				</td>
				<th>缴费起始日期</th>
				<td>
					<input name="beginDate" id ="beginDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate" readonly="readonly" disabled="disabled"
						value="<fmt:formatDate value="${bsChargeLogVaccList.beginDate}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
				</td>
				<th>缴费截止日期</th>
				<td>
					<input name="endDate" id ="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate" readonly="readonly" disabled="disabled"
						value="<fmt:formatDate value="${bsChargeLogVaccList.endDate}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
				</td>
			</tr>
		</table>
		<input onclick="down()" class="btn btn-primary" type="button" value="导出"/>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
			    <th>编号</th>
			    <th>归属区域</th>
			    <th>接种门诊</th>
			    <th>疫苗名称</th>
			    <th>生产厂商</th>
				<th>批号</th>
				<th>剂量</th>
				<th>疫苗单价</th>
				<th>使用数量</th>
				<th>总价</th>
				<th>支付方式</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="bsChargeLogVaccList" begin="0" varStatus="status">
			<tr data-localCode="${bsChargeLogVaccList.localCode}">
			    <td>
					${(page.pageNo-1)*page.pageSize+status.index+1 }
				</td>
				<td>
					${bsChargeLogVaccList.areaName}
				</td>
				<td>
					${bsChargeLogVaccList.department}
				</td>
				<td>
					<c:if test="${not empty bsChargeLogVaccList.vaccName}">
					   ${bsChargeLogVaccList.vaccName}
				    </c:if>
				    <c:if test="${empty bsChargeLogVaccList.vaccName}">
					   无
				    </c:if>
				</td>
				<td>
					${bsChargeLogVaccList.vaccManufacturer}
				</td>
				<td>
					${bsChargeLogVaccList.vaccBatchnum}
				</td>
				<td>
					${bsChargeLogVaccList.vaccDose}
				</td>
				<td style = "text-align: right; padding-right: 10px">
					￥${bsChargeLogVaccList.vaccPrice}
				</td>
				<td>
					${bsChargeLogVaccList.vaccCount}
				</td>
				<td style = "text-align: right; padding-right: 10px">
					￥${bsChargeLogVaccList.sum}
				</td>
				<td>
					${fns:getDictLabel(bsChargeLogVaccList.paytype, 'payType', '') }
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>